<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: mod_timer.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mod__timer_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">mod_timer.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>system timer control module  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;or1k-sprs.h&gt;</code><br />
<code>#include &lt;or1k-support.h&gt;</code><br />
<code>#include &quot;<a class="el" href="mod__timer_8h_source.html">mod_timer.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a161432848a326da3a1ea7765fc2bc023"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__timer_8c.html#a161432848a326da3a1ea7765fc2bc023">timer_start</a> ()</td></tr>
<tr class="memdesc:a161432848a326da3a1ea7765fc2bc023"><td class="mdescLeft">&#160;</td><td class="mdescRight">start system timer in continues mode  <a href="#a161432848a326da3a1ea7765fc2bc023">More...</a><br /></td></tr>
<tr class="separator:a161432848a326da3a1ea7765fc2bc023"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa04078f48a0e8f5b6860a393ad06b535"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__timer_8c.html#aa04078f48a0e8f5b6860a393ad06b535">timer_stop</a> ()</td></tr>
<tr class="memdesc:aa04078f48a0e8f5b6860a393ad06b535"><td class="mdescLeft">&#160;</td><td class="mdescRight">stop system timer  <a href="#aa04078f48a0e8f5b6860a393ad06b535">More...</a><br /></td></tr>
<tr class="separator:aa04078f48a0e8f5b6860a393ad06b535"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef86d8f8e96209074113a6579ba042ce"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__timer_8c.html#aef86d8f8e96209074113a6579ba042ce">timer_cnt_set</a> (uint32_t cnt)</td></tr>
<tr class="memdesc:aef86d8f8e96209074113a6579ba042ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">set system timer counter value  <a href="#aef86d8f8e96209074113a6579ba042ce">More...</a><br /></td></tr>
<tr class="separator:aef86d8f8e96209074113a6579ba042ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0b22a5df951fddf6977edf3b1cd55f6"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__timer_8c.html#ac0b22a5df951fddf6977edf3b1cd55f6">timer_cnt_get</a> ()</td></tr>
<tr class="memdesc:ac0b22a5df951fddf6977edf3b1cd55f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">get system timer counter value  <a href="#ac0b22a5df951fddf6977edf3b1cd55f6">More...</a><br /></td></tr>
<tr class="separator:ac0b22a5df951fddf6977edf3b1cd55f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a197b3a4ed7085bc37f8dcb177c80486f"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__timer_8c.html#a197b3a4ed7085bc37f8dcb177c80486f">timer_cnt_get_64</a> ()</td></tr>
<tr class="memdesc:a197b3a4ed7085bc37f8dcb177c80486f"><td class="mdescLeft">&#160;</td><td class="mdescRight">get system timer counter total value  <a href="#a197b3a4ed7085bc37f8dcb177c80486f">More...</a><br /></td></tr>
<tr class="separator:a197b3a4ed7085bc37f8dcb177c80486f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>system timer control module </p>
<dl class="section note"><dt>Note</dt><dd>timer frequency (TIMER_FREQUENCY) is same as CPU frequency</dd></dl>
<p>This module implements an API to the system timer </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a161432848a326da3a1ea7765fc2bc023"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a161432848a326da3a1ea7765fc2bc023">&#9670;&nbsp;</a></span>timer_start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void timer_start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>start system timer in continues mode </p>
<dl class="section note"><dt>Note</dt><dd>timer counter value is not affected by this function </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_timer_8c-example.html#a1">mod_timer.c</a>.</dd>
</dl>
</div>
</div>
<a id="aa04078f48a0e8f5b6860a393ad06b535"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa04078f48a0e8f5b6860a393ad06b535">&#9670;&nbsp;</a></span>timer_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void timer_stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>stop system timer </p>
<dl class="section note"><dt>Note</dt><dd>timer counter value is not affected by this function </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_timer_8c-example.html#a4">mod_timer.c</a>.</dd>
</dl>
</div>
</div>
<a id="aef86d8f8e96209074113a6579ba042ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef86d8f8e96209074113a6579ba042ce">&#9670;&nbsp;</a></span>timer_cnt_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void timer_cnt_set </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cnt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set system timer counter value </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cnt</td><td>new value (in ticks) for the system timer counter </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_timer_8c-example.html#a2">mod_timer.c</a>.</dd>
</dl>
</div>
</div>
<a id="ac0b22a5df951fddf6977edf3b1cd55f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0b22a5df951fddf6977edf3b1cd55f6">&#9670;&nbsp;</a></span>timer_cnt_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t timer_cnt_get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get system timer counter value </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0..0xFFFFFFFF</td><td>(ticks) </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_timer_8c-example.html#a3">mod_timer.c</a>.</dd>
</dl>
</div>
</div>
<a id="a197b3a4ed7085bc37f8dcb177c80486f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a197b3a4ed7085bc37f8dcb177c80486f">&#9670;&nbsp;</a></span>timer_cnt_get_64()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t timer_cnt_get_64 </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get system timer counter total value </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>.. 2^64-1 (ticks) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="mod__timer_8c.html">mod_timer.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
